#pragma once
#include "Text.h"
#include "Texture.h"

namespace Fysics
{
	class Panel
	{
	private:
		glm::vec3 m_BaseColor;
		unsigned int m_Width;
		unsigned int m_Height;

		std::vector<Ref<Text>> m_TextList;

		void BakeTextToBuffer(const Text& text, unsigned char* outBuffer);
		void BakeCharToBuffer(int startX, int startY, unsigned int width, unsigned int height,
			unsigned char* data, unsigned char* outBuffer, const glm::vec3& color);
	public:
		Panel();
		virtual ~Panel();

		Panel& SetWidth(unsigned int width);
		Panel& SetHeight(unsigned int height);
		Panel& SetBaseColor(const glm::vec3& color);

		Panel& AddText(Ref<Text>& text);
		Texture* BakeTexture();
	};
}